import { combineResolvers } from 'graphql-resolvers'
import { resolve } from 'url'
import { reject } from 'any-promise'
module.exports = {
  Query: {
    getCosAuth: combineResolvers(
      async (root, { dir }, { services: { $cos } }) => {
        return new Promise((resolve, reject) => {
          $cos.getTempKeys((err, tempKeys) => {
            if (err) reject(err)
            resolve(tempKeys)
          })
        })
      }
    )
  }
}
